package com.yunhe.entity;



import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;

import javax.persistence.ManyToOne;

import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
 * 投票选项实体类
 * */
@Entity
@Table(name="vote_option")
public class Option {
	//编号
	@Id
	@SequenceGenerator(name="SEQ_VOTE_OPTION",sequenceName="SEQ_VOTE_OPTION",allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SEQ_VOTE_OPTION")
	@Column(name="vo_id")
	private Integer vo_id;
	//投票选项
	@Column(name = "vo_option")
	private String vo_option;
	//投票内容
	@ManyToOne(cascade={CascadeType.PERSIST,CascadeType.REMOVE},fetch = FetchType.EAGER)
	@JoinColumn(name="vs_id")
	private Subject subject;
	
	//显示顺序
	@Column(name = "vo_order")
	private Integer vo_order;
	@Transient
	private Integer size;
	@Transient
	private Integer sizePer;
	
	public Integer getSizePer() {
		return sizePer;
	}
	public void setSizePer(Integer sizePer) {
		this.sizePer = sizePer;
	}
	public Integer getSize() {
		return size;
	}
	public void setSize(Integer size) {
		this.size = size;
	}
	public Integer getVo_id() {
		return vo_id;
	}
	public void setVo_id(Integer vo_id) {
		this.vo_id = vo_id;
	}
	public String getVo_option() {
		return vo_option;
	}
	public void setVo_option(String vo_option) {
		this.vo_option = vo_option;
	}
	public Subject getSubject() {
		return subject;
	}
	public void setSubject(Subject subject) {
		this.subject = subject;
	}
	public Integer getVo_order() {
		return vo_order;
	}
	public void setVo_order(Integer vo_order) {
		this.vo_order = vo_order;
	}
	
}
